<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>Json Tree Inspector</title>


	<!-- YUI CSS -->
	<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
	<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
	<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

	<!-- InputEx CSS -->
	<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<style>

#formContainer {
	margin:40px auto;
	width: 80%;
	background-color: #ccccff;
	padding: 20px;
}

</style>

 </head>

<body class="yui-skin-sam">
	
	<div id='formContainer'></div>
	
<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo/yahoo-min.js"></script> 
<script type="text/javascript" src="../lib/yui/dom/dom-min.js"></script> 
<script type="text/javascript" src="../lib/yui/event/event-min.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>
<script type="text/javascript" src="../lib/yui/json/json-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/widgets/json-tree-inspector.js"></script>

<script>

YAHOO.util.Event.addListener(window, "load", function() {
	
	var schemaIdentifierMap = {
		
	 "Person": {
		"id": "Person",
		"description":"A person",
	 	"type":"object",
	 	"properties": {
	  	"name": {
				"type":"string"
			},
	    "born" : {
				"type":"string",
	      "format":"date",
	      "optional":true
			},
	    "gender" : {
				"type":"string",
	      "options": [
	       	{"value":"male","label":"Guy"},
	        {"value":"female","label":"Girl"}
				]
			},
			"grownup": {
				"type": "boolean"
			},
			"favoritecolors": {
				"type": "array"
			},
	    "address": {
				"type":"object",
	      "properties":{
	      	"street":{"type":"string"},
	        "city":{"type":"string"},
	        "state":{"type":"string"}
	      }
	    }
	  }
	 }
	};
	
	new YAHOO.inputEx.widget.JsonTreeInspector('formContainer', schemaIdentifierMap);
	
});

</script>


 </body>
</html>